Package-level declarations

This is the top level entrypoint to use the SDK. It contains components to discover, connect, and retrieve a GoPro.

SDK Initialization

Before performing any operations, the SDK must first be initialized with a desired coroutine scope and a platform-specific OgpSdkAppContext.

// App context is platform-specific context passed from application
val sdk = OgpSdk(Dispatchers.IO, appContext)

GoPro Identifier

GoPro devices on all network mediums and their resulting GoPro objects are always identified by a GoProId which consists of the last 4 digits of the serial number.

SDK Overview

The SDK maintains a run-time database of GoPro objects that can be retrieved by GoProId. It manages storing network connections (identified by GoProId) and binding / unbinding these to GoPro objects as needed.

It is the user's responsibility to establish a connection via OgpSdk.connect. The SDK will then bind this to any existing GoPro objects

At any time the user can use OgpSdk.getGoPro to retrieve a GoPro which will be bound to all available network connections.

Discovering

The first step to connecting is to discover a GoPro device via OgpSdk.discover:

// Discover and take the first device we find
val device = sdk.discover(NetworkType.BLE).first()

Note that the user can freely choose any combination of network types.

Connecting

Discovered devices can be connected to via OgpSdk.connect

// Connect (assume success)
val goproId = sdk.connect(device).getOrThrow()

On success, the SDK will store this connection and bind to any pre-existing GoPro objects.

GoPro Retrieval

At any time, the user can attempt to retrieve a GoPro object (by its GoProId) via OgpSdk.getGoPro:

val gopro = sdk.getGoPro(goproId)

This will succeed as long as their is at least one available network connection. If there are no available network connections, a DeviceNotFound exception will be returned in the Failure result and the user must establish a connection before proceeding.

For information on how to work with the retrieved GoPro, see the GoPro package TODO link.

This is the top level entrypoint to use the SDK. It contains components to discover, connect, and retrieve a com.gopro.open_gopro.gopro.GoPro.

SDK Initialization

Before performing any operations, the SDK must first be initialized with a desired coroutine scope and a platform-specific OgpSdkAppContext.

// App context is platform-specific context passed from application
val sdk = OgpSdk(Dispatchers.IO, appContext)

GoPro Identifier

GoPro devices on all network mediums and their resulting com.gopro.open_gopro.gopro.GoPro objects are always identified by a GoProId which consists of the last 4 digits of the serial number.

SDK Overview

The SDK maintains a run-time database of com.gopro.open_gopro.gopro.GoPro objects that can be retrieved by GoProId. It manages storing network connections (identified by GoProId) and binding / unbinding these to com.gopro.open_gopro.gopro.GoPro objects as needed.

It is the user's responsibility to establish a connection via OgpSdk.connect. The SDK will then bind this to any existing com.gopro.open_gopro.gopro.GoPro objects

At any time the user can use OgpSdk.getGoPro to retrieve a com.gopro.open_gopro.gopro.GoPro which will be bound to all available network connections.

Discovering

The first step to connecting is to discover a GoPro device via OgpSdk.discover:

// Discover and take the first device we find
val device = sdk.discover(NetworkType.BLE).first()

Note that the user can freely choose any combination of network types.

Connecting

Discovered devices can be connected to via OgpSdk.connect

// Connect (assume success)
val goproId = sdk.connect(device).getOrThrow()

On success, the SDK will store this connection and bind to any pre-existing com.gopro.open_gopro.gopro.GoPro objects.

GoPro Retrieval

At any time, the user can attempt to retrieve a com.gopro.open_gopro.gopro.GoPro object (by its GoProId) via OgpSdk.getGoPro:

val gopro = sdk.getGoPro(goproId)

This will succeed as long as their is at least one available network connection. If there are no available network connections, a DeviceNotFound exception will be returned in the Failure result and the user must establish a connection before proceeding.

For information on how to work with the retrieved com.gopro.open_gopro.gopro.GoPro, see the GoPro package TODO link.

This is the top level entrypoint to use the SDK. It contains components to discover, connect, and retrieve a GoPro.

SDK Initialization

Before performing any operations, the SDK must first be initialized with a desired coroutine scope and a platform-specific OgpSdkAppContext.

// App context is platform-specific context passed from application
val sdk = OgpSdk(Dispatchers.IO, appContext)

GoPro Identifier

GoPro devices on all network mediums and their resulting GoPro objects are always identified by a GoProId which consists of the last 4 digits of the serial number.

SDK Overview

The SDK maintains a run-time database of GoPro objects that can be retrieved by GoProId. It manages storing network connections (identified by GoProId) and binding / unbinding these to GoPro objects as needed.

It is the user's responsibility to establish a connection via OgpSdk.connect. The SDK will then bind this to any existing GoPro objects

At any time the user can use OgpSdk.getGoPro to retrieve a GoPro which will be bound to all available network connections.

Discovering

The first step to connecting is to discover a GoPro device via OgpSdk.discover:

// Discover and take the first device we find
val device = sdk.discover(NetworkType.BLE).first()

Note that the user can freely choose any combination of network types.

Connecting

Discovered devices can be connected to via OgpSdk.connect

// Connect (assume success)
val goproId = sdk.connect(device).getOrThrow()

On success, the SDK will store this connection and bind to any pre-existing GoPro objects.

GoPro Retrieval

At any time, the user can attempt to retrieve a GoPro object (by its GoProId) via OgpSdk.getGoPro:

val gopro = sdk.getGoPro(goproId)

This will succeed as long as their is at least one available network connection. If there are no available network connections, a DeviceNotFound exception will be returned in the Failure result and the user must establish a connection before proceeding.

For information on how to work with the retrieved GoPro, see the GoPro package TODO link.

Types

Link copied to clipboard
class BleError(errorMessage: String) : Exception
Link copied to clipboard
Link copied to clipboard
sealed interface ConnectionRequestContext

Per-network-type additional connection request information.

Link copied to clipboard
class DeviceNotFound(deviceId: String) : Exception
Link copied to clipboard
data class GoProId(val partialSerial: String)

The identifier of a connected GoPro

Link copied to clipboard
class HttpError(code: Int, errorMessage: String) : Exception

Represents server (50x) and client (40x) errors.

Link copied to clipboard
class NetworkError(message: String) : Exception

Represent IOExceptions and connectivity issues.

Link copied to clipboard
Link copied to clipboard
class OgpSdk(dispatcher: CoroutineDispatcher, appContext: OgpSdkAppContext)

The top level SDK interface

Link copied to clipboard
actual class OgpSdkAppContext
actual class OgpSdkAppContext
expect class OgpSdkAppContext

Platform-specific context needed to initialize the OGP SDK

Link copied to clipboard
sealed interface ScanResult

Network-type-specific GoPro device discovery results